<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!doctype html>
<html class="bg-white">
<head>
<meta charset="utf-8">
<title>添加就诊人信息</title>
<link type="text/css" rel="stylesheet" href="${yyghStatic}/modules/yygh/css/mobiscroll.2.13.2.css?rev=25879f12ca807894"/>
<%@ include file="/WEB-INF/views/include/head_mobile.jsp" %>
</head>
<body class="${sessionScope.SESSION_KEY_THIRD_CHANNEL.isNav==1?'pdt90':''}">
<c:if test="${not empty message}">
	<script type="text/javascript">
		layer.alert('${message}');
	</script>
</c:if>
<div class="ui-main pdb220">
    <div class="header-nav">
        <a href="javascript:void(0)" class="h-left" id="btn_goback">
            <i class="ui-trigger"></i>返回</a>
        <span id="id_nav_title">挂号系统</span>
    </div>
	<form action="${ctxMobile}/yygh/user/addPatientPro" id="myfrm" name="myfrm" method="post">
	<input type="hidden" name="userId" id="userId" value="${userId}"/>
	<input type="hidden" name="channelId" id="channelId" value="${channelId}" />
	<input type="hidden" name="thirdUserId" id="thirdUserId" value="${thirdUserId}" />
    <div class="common-flex-box pd0-45 border-bottom bg-white">
        <div class="common-flex-item border-bottom">
            <div class="common-flex-left">姓名</div>
            <div class="common-flex-right">
                <input type="text" name="patientName" id="patientName" value="${patient.patientName}" class="common-input-text" placeholder="请输入就诊人名称" />
            </div>
        </div>
        <div class="common-flex-item border-bottom">
            <div class="common-flex-left">手机号</div>
            <div class="common-flex-right">
                <input type="tel" name="tel" id="tel" value="${patient.tel}" class="common-input-text" placeholder="请输入手机号" />
            </div>
        </div>
        <div class="common-flex-item border-bottom">
            <i class="ui-trigger trig-down"></i>
            <div class="common-flex-left">证件类型</div>
            <div class="common-flex-right">
                <select class="common-select" name="cardType" id="cardType">
                    <option value="1" selected>身份证</option>
                </select>
            </div>
        </div>
        <div class="common-flex-item border-bottom">
            <div class="common-flex-left">证件号码</div>
            <div class="common-flex-right">
                <div class="common-flex-right">
                    <input type="text" name="cardNo" id="cardNo" value="${patient.cardNo}"  class="common-input-text" placeholder="请输入证件号码" />
                </div>
            </div>
        </div>
        <div class="common-flex-item border-bottom">
            <div class="common-flex-left">地址</div>
            <div class="common-flex-right">
                <div class="common-flex-right">
                    <input type="text" name="address" id="address" class="common-input-text" value="${patient.address}" placeholder="请输入地址" />
                </div>
            </div>
        </div>
        <div class="common-flex-item border-bottom">
            <i class="ui-trigger trig-down"></i>
            <div class="common-flex-left">性别</div>
            <div class="common-flex-right">
                <select class="common-select" name="sex" id="sex">
                    <option value="1" ${patient.sex=="1"?'selected':''}>男</option>
                    <option value="2" ${patient.sex=="2"?'selected':''}>女</option>
                </select>
            </div>
        </div>
        <div class="common-flex-item">
            <div class="common-flex-left">出生日期</div>
            <div class="common-flex-right">
                <input type="text" name="birthday" id="birthday" value="${patient.birthday}"  class="common-input-text date-time-input" placeholder="请输入出生日期" />
            </div>
        </div>
    </div>
    </form>
    <div class="index-tip">
        温馨提示：<br />
        请确保就诊人信息真实有效，以免影响正常就诊！
    </div>
</div>
<div class="fixed-bottom">
    <div class="pd60-100">
        <a href="javascript:void(0)" class="common-btn btn-main-grid btn-radius" id="btn_save">保存</a>
    </div>
</div>
</body>
<script type="text/javascript" src="${yyghStatic}/modules/yygh/js/mobiscroll.2.13.2.js"></script>
<script type="text/javascript" src="${yyghStatic}/modules/yygh/js/ui_mobiscroll.js"></script>
<script type="text/javascript">
	function showMsg(msg) {
		layer.alert(msg);
	}
    $(function(){
	   	$("#btn_goback").click(function(){
	   		window.history.go(-1);
	   	});
	    $('.more-op-btn').on('click',function(){
	        var cobj = $(this).siblings('.common-flex-box');
	        if(cobj.is(':visible')){
	            cobj.hide();

	            $(this).find('em').text('收起');
	            $(this).removeClass('active');
	        }else{
	            cobj.show();
	            $(this).find('em').text('编辑就诊人');
	            $(this).addClass('active');
	        }
	    })
    	$("#btn_save").click(function(){
			if(!checkMobile($("#myfrm #tel").val())) {
				showMsg('手机号码错误！');
				return false;
			}
			if( !IdentityCodeValid($("#myfrm #cardNo").val())){
				showMsg('身份证错误！');
				return false;
			}
    		$("#myfrm").submit();
    	});
    	PLUGINSCROLL.MOBILE_DATE_SCROLL.mobileScrollDate($('.date-time-input'),new Date(),new Date('1900/01/01'),function(){});
    });
</script>
</html>
